package com.chaosj.webmagic;

import org.apache.commons.lang3.StringUtils;

import java.util.Optional;

/**
 * @className: DefaultLocalFileService
 * @description:
 * @author: caoyangjie
 * @date: 2022/3/21
 **/
public class DefaultLocalFileService{
    private static String localBasePath;

    public static String basePath() {
        return Optional.ofNullable(localBasePath).orElse("/home/caoyangjie/gitbook");
    }

    public static void set(String basePath) {
        if(StringUtils.isEmpty(localBasePath) ){
            localBasePath = basePath;
        }
    }
}
